﻿@model LogManager.ViewModels.LogList
       
@using MvcContrib.UI.Grid;
@using MvcContrib.Pagination;
@using MvcContrib.UI.Pager;
@using LogManager.Helpers;       
           
<div class="logs">
    @(Html.Pager(Model.Logs).First("First").Previous("Previous").Next("Next").Last("Last"))
    <br />
    @(Html.Grid<LogManager.Base.ILog>(Model.Logs).Columns(column =>
    {
        column.For(l => l.ServerName).Header("Server");
        column.For(l => Html.ActionLink(l.LogName, "Detail", "Log", new { logName = l.LogName, serverName = l.ServerName }, null)).Named("LogName").Header("Log");        
        column.For(l => l.LastWriteTime);
        column.For(l => l.Count);
        column.For(l => Html.ActionLink("Feed", "ListFeed", "Log", new { serverName = l.ServerName, logName = l.LogName }, new { target = "_blank" })).Attributes(e => new Dictionary<string, object> { { "class", "rss" } }).Header("RSS").Sortable(false);
    }).Sort(Model.SortOptions))    
</div>

<script type="text/javascript">
    jQuery(document).ready(function () {
        $.ajaxLinkHandler('.logs .pagination a, .logs th a', '.logs', '.logs .grid');
    });
</script>